package com.btpj.jetpack.http.interceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * okHttp拦截器
 *
 * @author LTP 2020/7/8
 */
class CommonInterceptor : Interceptor {

    override fun intercept(chain: Interceptor.Chain): Response {
        val builder = chain.request().newBuilder()
            // 添加全局Header
            .addHeader("Content_Type", "application/json")
            .addHeader("charset", "UTF-8")
            .build()
        return chain.proceed(builder)
    }
}